package com.weixin.paleituo.bean;

import android.support.annotation.NonNull;

import com.weixin.paleituo.util.LogUtils;

import java.util.List;

/**
 * Author yichao
 * Time  2018/3/12 15:53
 * Dest  楼盘
 */

public class HomeHouseBean implements Comparable<HomeHouseBean>{
    /**
     * id : 170
     * token : null
     * pushSign : null
     * cityName : 成都
     * houses : 花样年年
     * money : 8000元/平
     * tags : 花样,住宅,学区房
     * imgList : http://p35r91t1w.bkt.clouddn.com/FsjWqGDLzq-SSwK5zBpBHyVEMK2w
     * address : 成华区-东客站西广场300米
     */

    private int id;
    private String cityName;
    private String spell;
    private String houses;
    private String money;
    private List<String> tags;
    private String imgList;
    private String address;
    private int soldStatus;

    public int getSoldStatus() {
        return soldStatus;
    }

    public void setSoldStatus(int soldStatus) {
        this.soldStatus = soldStatus;
    }

    public String getSpell() {
        return spell;
    }

    public void setSpell(String spell) {
        this.spell = spell;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public String getHouses() {
        return houses;
    }

    public void setHouses(String houses) {
        this.houses = houses;
    }

    public String getMoney() {
        return money;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public String getImgList() {
        return imgList;
    }

    public void setImgList(String imgList) {
        this.imgList = imgList;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
    @Override
    public int compareTo(@NonNull HomeHouseBean o) {
        if (o instanceof HomeHouseBean) {
            HomeHouseBean itemInfo = (HomeHouseBean) o;
            if (Character.isLetter(getSpell().charAt(0))
                    && Character.isLetter(itemInfo.getSpell().charAt(0))) {

                LogUtils.i("hoem_house","compareTo");
                return this.spell.compareTo(itemInfo.spell);
            } else if (Character.isLetter(getSpell().charAt(0))) {
                LogUtils.i("hoem_house","-1");
                return -1;
            } else if (Character.isLetter(itemInfo.getSpell().charAt(0))) {
                LogUtils.i("hoem_house","1");
                return 1;
            }
            LogUtils.i("hoem_house","0");
            return 0;
        }
        throw new IllegalArgumentException();
    }


}
